#encoding:utf-8

import json
import os

workSpace = './'
stdList = [
{
    'inFile' : '1.in',
    'outFile' : '1.out'
}]

class JudgeCore:
    @staticmethod
    def judge(path, className, stdIn, stdOut):
        com = 'java -cp "%s" %s < "%s" > "%s" 2>&1' % (path, className, stdIn, stdOut)
        print(com)
        ret = os.popen(com).readlines()
        print(ret)
    @staticmethod
    def compile(path, className):
        com = 'javac -d "%s" "%s\\%s.java" 2>&1' % (path, path, className)
        ret = os.popen(com).readlines()
        print("编译%s\n编译输出：%s" % (path, ret))
        
path = r'C:\Users\ospip\Desktop\170912JAVA\problem\SpiralMatrix\std'
className = 'SpiralMatrix'
outpre = r'C:\Users\ospip\Desktop\170912JAVA\problem\SpiralMatrix\data'
for i in range(1, 11):
    JudgeCore.judge(path, className, outpre + '\\%d.in' % (i), outpre + '\\%d.out' % (i))